var postsData = require('../../data/posts-data.js')
Page({
  /**
   * 页面的初始数据
   */
  data: {
    date: "Sep 18 2018",
    title: "正是虾肥蟹壮时"
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.setData({
      posts_key: postsData.postList
    });
  },
  onPostTap: function(event) {
    var postId = event.currentTarget.dataset.postid;
    wx.navigateTo({
      url: 'post-detail/post-detail?id=' + postId,
    })
  },
  onaSwiperTap: function(event) {
    var postId = event.target.dataset.postid;
    console.log(postId);
    wx.navigateTo({
      url: 'post-detail/post-detail?id=' + postId,
    })
  }

})